|
Hardware Unique ID Extractor
|
||||
TOC |
Programing language: C++ Enviroment: Embarcadero C++ Builder Source code by: For Hardware ID Extractor DLL version: 2.0
|
|||
Example for C++ Builder programmers
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
char* (__stdcall *GetIDESerialNumber)(BYTE);
HINSTANCE DllInst = NULL;
void __fastcall TForm1::Button1Click(TObject *Sender)
{
if (DllInst == NULL) DllInst = LoadLibrary("HardwareIDExtractorC.DLL");
if (DllInst)
{
GetIDESerialNumber = (char* (__stdcall*)(BYTE))GetProcAddress(DllInst, "GetIDESerialNumber");
//Now call the imported function
Edit1->Text = GetIDESerialNumber(0); // 0 = first IDE hard drive in your system
}
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if ( DllInst ) FreeLibrary (DllInst);
}
Note: Don't forget to call ReleaseMemory when you are done with the function.
|
||||